import { Component, OnInit } from '@angular/core';
import {format, startOfMonth, endOfMonth, subMonths, subDays} from 'date-fns';
import * as moment from "moment";

@Component({
  selector: 'app-hr-statistics',
  templateUrl: './hr-statistics.component.html',
  styleUrls: ['./hr-statistics.component.scss']
})
export class HrStatisticsComponent implements OnInit {
    topDateModal = [startOfMonth(subMonths(new Date(), 1)), subDays(new Date(), 1)];
    topDateRanges = {
        '昨日': [
            moment().subtract(1, 'days').valueOf(),
            moment().subtract(1, 'days').valueOf()
        ],
        '3日': [
            moment().subtract(3, 'days').valueOf(),
            new Date()
        ],
        '7日': [
            moment().subtract(7, 'days').valueOf(),
            new Date()
        ],
        '本月': [
            moment().startOf('month').valueOf(),
            new Date()
        ],
        '上月': [
            moment().subtract(1, 'months').startOf('month').valueOf(),
            moment().subtract(1, 'months').endOf('month').valueOf()
        ],
        '近3月': [
            moment().subtract(3, 'months').startOf('month').valueOf(),
            new Date()
        ],
    };
    radioValue = 'single';

    constructor() {
    }

    ngOnInit(): void {
    }
}
